package com.sunny.example.hwrealexame;

import java.util.Scanner;

/**
 * 查找字符串中相同字符连续出现的最大次数
 */
public class Exame1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String input = scanner.nextLine();
            if ("".equals(input) || input.length() > 100) {
                continue;
            }
            int result = 1;
            int tmp = 1;
            for (int i = 0; i < input.length() - 1; i++) {
                char c = input.charAt(i);
                tmp = 1;
                for (int j = i + 1; j < input.length(); j++) {
                    char c2 = input.charAt(j);
                    if (c == c2) {
                        tmp++;
                    } else {
                        break;
                    }
                    result = Math.max(result, tmp);
                }
            }
            System.out.println(result);
        }
    }
}
